package top.ffhome.concurrent.beautiful.ch01;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

public class ThreadLocalTest2 {
    private static final Log log = LogFactory.get();
    static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public static void main(String[] args) throws InterruptedException {
        threadLocal.set("hello world");
        Thread thread = new Thread(() -> {
            log.info("thread:{}", threadLocal.get());
        });
        thread.start();
        log.info("main:{}", threadLocal.get());
    }
}
